package minijava_scanner;

import minijava_scanner.scanner.Scanner;
import minijava_scanner.scanner.TerminalSymbol;
import minijava_scanner.scanner.Token;

import java.io.*;

public class MiniJavaScannerMain
{
    public static void main(String args[])
    {
        try
        {
            InputStreamReader reader = new InputStreamReader(new FileInputStream(args[0]));
            Scanner scanner = new Scanner(reader);
            Token token = scanner.GetNextToken();
            while (token.GetId() != TerminalSymbol.EOF)
            {
                System.out.print(token);
                token = scanner.GetNextToken();
            }
        }
        catch (Exception ex)
        {
            System.out.println(ex.getMessage());
        }
    }
}
